//
// Created by 31897 on 2021/11/5.
//

#include <iostream>
#include <vector>
using namespace std;

vector<int> nums;

int min(vector<int> a){
    if(a.size()==1){
        return a[0];
    }
    int split = a.size()/2;
    vector<int> l(a.begin(),a.begin()+split);
    vector<int> r(a.begin()+split,a.end());
    if(min(l)<min(r)){
        return min(l);
    }
    else{
        return min(r);
    }
}

int main(){
    int n;
    cin >> n;
    for(int i = 0;i<n;i++){
        int temp;
        cin >> temp;
        nums.push_back(temp);
    }
    cout << min(nums);
    return 0;
}